/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 839398
 */
@Embeddable
public class TblNatilleraPersonaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "cod_natillera")
    private int codNatillera;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "doc_persona")
    private String docPersona;

    public TblNatilleraPersonaPK() {
    }

    public TblNatilleraPersonaPK(int codNatillera, String docPersona) {
        this.codNatillera = codNatillera;
        this.docPersona = docPersona;
    }

    public int getCodNatillera() {
        return codNatillera;
    }

    public void setCodNatillera(int codNatillera) {
        this.codNatillera = codNatillera;
    }

    public String getDocPersona() {
        return docPersona;
    }

    public void setDocPersona(String docPersona) {
        this.docPersona = docPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codNatillera;
        hash += (docPersona != null ? docPersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblNatilleraPersonaPK)) {
            return false;
        }
        TblNatilleraPersonaPK other = (TblNatilleraPersonaPK) object;
        if (this.codNatillera != other.codNatillera) {
            return false;
        }
        if ((this.docPersona == null && other.docPersona != null) || (this.docPersona != null && !this.docPersona.equals(other.docPersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Fondo=" + codNatillera + "- Persona=" + docPersona;
    }
    
}
